import java.util.ArrayList;

public class DiceSack{
	//Welcome to DiceSack.
	//This class is an interface of sorts between the main, and each individual die in 10k.
	//Rolling and the checking of values is performed here.
	
	ArrayList<Dice> diceBox = new ArrayList<Dice>();
	//The dicebox is a bit like the cup in Yahtzee. It's meant to 'hold' the die to cast them all at once.
	//Batch processing, so to speak.
	ArrayList<Integer> latestRolls = new ArrayList<Integer>();
	//This array hold the values that each die last rolled.
	//Ideally, the main never should concern itself with 'die', it only really needs to know the numbers. That's why this exists.
	
	public DiceSack(){
		addDice();
		addDice();
		addDice();
		addDice();
		addDice();
	}
	//The "dicesack" that this game utilises always contains 5 die; so they're initialised here. All 5!
	
	
	public void addDice(){
		diceBox.add(new Dice());
		}
	//AddDice adds a die to the dicesack. For now, it's only used in initialisation.
	
	
	public ArrayList<Integer> rollEach(){	//Rolls every die (5).
		
		for(Dice d : diceBox){
			d.roll();
		}
		for(int i = 0; i<5; i++){
			latestRolls.add(diceBox.get(i).getRoll());
		}
		return latestRolls;
	}
	
	
	

}
